import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import fire from '@dfeidao/atom-web/msg/fire';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import hide from '@dfeidao/atom-web/ui/hide';


export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// todo
	// 点击保存按钮时修改
	const div = fd.data.node.querySelector<HTMLSelectElement>('[data-id="meeting_status"]');
	const divDt = div.value;
	const no = get(fd, 'no');
	const ret = await nodejs<{ code: 0 | 1; result: string }>('meeting-management/zj-000003/s003', {
		meeting_status: divDt,
		meeting_no: no
	});
	if (ret.code === 1) {
		alert('修改成功');
		hide(fd.data.node);
		fire('zj-000001', 'a001');
		fire('zj-000001', 'a005');

	} else {
		alert('修改失败');
	}

}
